package com.ysy.tz.mfg.controller;

import com.ysy.tz.core.annotation.Service;
import com.ysy.tz.core.engine.DefaultKeyValuePair;
import com.ysy.tz.mfg.service.InspectionWeightService;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.ComboBox;

public class InspectionWeightAddController implements Initializable {
    @FXML
    ComboBox handleMethod;
    @FXML
    ComboBox pigTypeCode;
    @Service
    InspectionWeightService inspectionWeightService;
    ResourceBundle resourceBundle;

    public InspectionWeightAddController() {
    }

    public void initialize(URL location, ResourceBundle resources) {
        this.resourceBundle = resources;
        this.handleMethod.setItems(FXCollections.observableArrayList(new String[]{resources.getString("handleMethod_option1")}));
        this.handleMethod.getSelectionModel().selectFirst();
        ObservableList<DefaultKeyValuePair> pigTypeArrayList = FXCollections.observableArrayList(this.inspectionWeightService.searchPigType());
        this.pigTypeCode.setItems(pigTypeArrayList);
        this.pigTypeCode.getSelectionModel().selectFirst();
    }
}
